// koa-router中间键路由拦截
const Koa = require('koa');

const Router = require('koa-router');

const app = new Koa();

const router = new Router()

router.get('/', function(ctx, next) {
    ctx.body = 'Hello Koajs'
})
.get('/todo', (ctx, next) => {
    ctx.body = 'todo.html'
});

app
    .use(router.routes())
    .use(router.allowedMethods());

app.listen(3000, () => {
    console.log('koa server starting demo5.js')
})
